package thefirst.member.model;

import java.sql.SQLException;
import javax.annotation.Resource;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
/**
 * StudentOfMemberDaoImpl
 * 	MemberDao를 implements한 클래스.
 *  회원들이면 공통적으로 가지고 있는 메서드를 
 *  학생회원에 맞게 overriding 을 진행.
 *  
 *  sqlSessionTemplate을 활용해 Data access.
 * @author kosta-00-30
 *
 */
@Repository
public class StudentOfMemberDaoImpl implements MemberDao {	
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public void registerMember(MemberVO mvo) throws SQLException {
		sqlSessionTemplate.insert("member.registerStudent",mvo);
	}

	@Override
	public MemberVO showMember(MemberVO mvo) throws SQLException {
		return sqlSessionTemplate.selectOne("member.showStudent", mvo);
	}

	@Override
	public int updateName(MemberVO mvo) throws SQLException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateGender(MemberVO mvo) throws SQLException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public MemberVO login(MemberVO mvo) throws SQLException {
		return sqlSessionTemplate.selectOne("member.loginstudent", mvo);
	}

}
